<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @param string $action 该TOKEN可以执行的操作 ADD DELETE
 * @param int $expiry 该TOKEN有效时间 秒
 * @return string 
 */
function getToken($action,$expiry) {
    $appId = 'JC4E2637EC57BD1';
    $appKey = '6acda1e7491732d578564409dd4239d2';
    $tokenUrl = "http://127.0.0.1/jcomment/JcGetToken.php?app_id={$appId}&app_key={$appKey}&action={$action}&user=";
    return file_get_contents($tokenUrl);
}

echo getToken('ADD',300);
?>
